<script type="text/javascript">
    var searchUrl = "<?php echo site_url("social/search/"); ?>";
</script>
<script type="text/javascript">
    var searchUrl = "http://localhost:8888/wfaces/index.php/social/search";
</script>
<div class="row">
    <div class="span5 rounded">

        <div class="span5 rounded">
            <?php
            $attributes = array('id' => 'frm_search', 'class' => 'form-search');
            echo form_open('', $attributes);
            ?>
            <div class="input-append">
                <input title="search for a friend" class="search-query" type="text" style="width: 286px; "  name="search">
                <input type="submit" value="search" class="btn btn-primary" id="users_search"/>
            </div>
            <?php
            echo form_close();
            ?>
        </div>

        <div class="span5 rounded" style="border:1px solid #ccc;">
            <div class="row heightAndScroll">
                <?php
                $i = 0;

                foreach ($users as $u) {
                    if ($u->id != $user->id) {
                        ?>
                        <div class="span1 notSelected" style=" height: 60px; width:59px">
                            <a href="javascript:loadChatWith('<?php echo $u->id; ?>');">
                                <img src="<?php echo css_url("chat/with") . "../pht/" . $u->tof; ?>"  />
                            </a>
                            <!-- Tooltip of the image :
                                <div class="span2 notSelected">
                                <p><?php echo $u->firstname . " " . $u->lastname; ?></p>
                                <p><?php echo $u->city->name . ", " . $u->country->name; ?></p>
                                <p><?php echo $u->birthday; ?></p>
                                <span id="ntf<?php echo $u->id ?>"><?php echo $u->notifsForMe == 0 ? "" : $u->notifsForMe; ?></span>
                                <p><?php echo $u->statut; ?></p>
                                </div>
                            -->
                        </div>
                        <?php
                    }
                }
                ?>
            </div>
        </div>
    </div>
</div>
<script>
    $("#users_search").click(function() {
        search("frm_search");
        return false;
    });
</script>
